Skip to content

main: Rework sub states in STATE_TRIGGERING#126

Merged
jtguggedal merged 1 commit intomainfrom
main-sample-state
Mar 21, 2025
Merged

main: Rework sub states in STATE_TRIGGERING#126
jtguggedal merged 1 commit intomainfrom
main-sample-state

Conversation

@jtguggedal
Copy link
Copy Markdown
Contributor

The sub states in STATE_TRIGGERING have been updated to allow for a dedicated wait state, and to make it easier to have accurate intervals between samples.

Tests are updated, and we now also test that the correct interval is maintained over time.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Core Changes

  • The code refactors the state machine in the main.c file, specifically the sub-states within STATE_TRIGGERING. The changes introduce a dedicated wait state (STATE_WAIT_FOR_TRIGGER) and a more structured approach to sampling intervals, improving the accuracy and management of these intervals.
  • The test files have been updated to reflect these changes, including adjustments to the state transitions and the addition of new test cases to ensure the correct interval is maintained over time.

⚠️ Concerns

  • No critical concerns identified. The changes seem to be well-structured and aim to improve the functionality and accuracy of the state machine.
  1. Verdict:
    • Approve: The changes are well-implemented and improve the existing functionality. The refactoring of the state machine is clear and the tests have been updated accordingly to ensure the new logic is validated.

Code review performed by OPENAI - gpt-4o.

@jtguggedal jtguggedal force-pushed the main-sample-state branch 3 times, most recently from 2c380bb to 4aa8d46 Compare March 21, 2025 11:44
The sub states in STATE_TRIGGERING have been updated to allow
for a dedicated wait state, and to make it easier to have
accurate intervals between samples.

Tests are updated, and we now also test that the correct interval
is maintained over time.

Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
@sonarqubecloud
Copy link
Copy Markdown

@jtguggedal jtguggedal merged commit fc93fd6 into main Mar 21, 2025
4 checks passed
@jtguggedal jtguggedal deleted the main-sample-state branch March 21, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant